<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>个人中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <style type="text/css">
        .icon {
            width: 1em;
            height: 1em;
            vertical-align: -0.15em;
            fill: currentColor;
            overflow: hidden;
        }
    </style>
    <!--标准mui.css-->
    <link rel="stylesheet" href="__TMPL__/public/assets/wuye/css/mui.min.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/assets/wuye/css/app.css"/>
</head>

<body>

<header class="mui-bar mui-bar-nav" id="header">
    <!--<a class="mui-icon mui-icon-left-nav mui-pull-left" href="index.html"></a>-->
    <h1 class="mui-title">个人中心</h1>
    <!--<a class="mui-icon  mui-pull-right" style="font-size: 16px;padding-top: 0px;" href="#picture">-->
        <!--<i class="mui-icon mui-icon-compose"></i>发布-->
    <!--</a>-->
</header>
<nav class="mui-bar mui-bar-tab">
    <a class="mui-tab-item" href="index.html">
        <span class="mui-icon mui-icon-home" id="home1"></span>
        <span class="mui-tab-label">首页</span>
    </a>
    <a class="mui-tab-item" href="service.html">
        <span class="mui-icon mui-icon-pengyouquan"></span>
        <span class="mui-tab-label">服务</span>
    </a>
    <a class="mui-tab-item" href="http://qiangcai.mingruisoft.com/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=quick&id=1
">
        <span class="mui-icon"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-tiaozaoshichang01"></use></svg></span>
        <span class="mui-tab-label">快捷订菜</span>
    </a>
    <a class="mui-tab-item mui-active" href="me.html">
        <span class="mui-icon mui-icon-contact"></span>
        <span class="mui-tab-label">我的</span>
    </a>
</nav>
<div class="mui-content">
    <div class="mui-card">
        {:widget('Wuye/info')}
    </div>
    <ul class="mui-table-view">
        <li class="mui-table-view-cell" id="changePhone"><span class="mui-navigate-right">更改手机</span></li>
        <li class="mui-table-view-cell" id="changeName"><span class="mui-navigate-right">更改昵称</span></li>
        <li class="mui-table-view-cell"><a class="mui-navigate-right" href="payquery.html">账单详情</a></li>
        <li class="mui-table-view-cell"><a class="mui-navigate-right" href="baoxiudan.html">报修单</a></li>
        <li class="mui-table-view-cell"><a class="mui-navigate-right" href="payquery.html">缴费明细</a></li>
        <li class="mui-table-view-cell"><a class="mui-navigate-right" href="address.html">房屋信息</a></li>
        <li class="mui-table-view-cell"><a class="mui-navigate-right" href="tel:{$info.phone}">联系物业：{$info.phone}</a></li>
        <!--<li class="mui-table-view-cell"><a class="mui-navigate-right" href="rental.html">发布房租租售</a></li>-->
    </ul>
</div>
</body>
<script src="__TMPL__/public/assets/wuye/js/mui.min.js"></script>
<script src="__TMPL__/public/assets/wuye/js/iconfont.js"></script>
<script type="text/javascript">
    mui("#changePhone")[0].addEventListener("tap",function(){
        mui.prompt('','请输入手机号','请输入手机号',['取消','确定'],function (e) {
//            0:确定；1：取消
            if(e.index != 0){
                if(e.value != ''){
                    var pattern=/(^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$)|(^0{0,1}1[3|4|5|6|7|8|9][0-9]{9}$)/;
                    if(pattern.test(e.value)) {
                        mui.ajax("{:url('portal/wuye/getPhone')}",{
                            data:{phone:e.value},
                            dataType:'json',//服务器返回json格式数据
                            type:'post',//HTTP请求类型
                            timeout:10000,//超时时间设置为10秒；
                            headers:{'Content-Type':'application/json'},
                            success:function(data){
                                if(data == 1){
                                    mui.toast("手机号修改为："+e.value);
                                }else{
                                    mui.toast(data);
                                }
                            },
                            error:function(xhr,type,errorThrown){
                                //异常处理；
                                console.log(type);
                            }
                        });
                    }else{
                        mui.toast('手机号码格式错误');
                    }
                }else{
                    mui.toast('手机号码不能为空');
                }
            }
        });
    });
    mui("#changeName")[0].addEventListener("tap",function(){
        mui.prompt('','请输入昵称','请输入昵称',['取消','确定'],function (e) {
//            0:确定；1：取消
            if(e.index != 0){
                if(e.value != ''){
                    mui.ajax("{:url('portal/wuye/changename')}",{
                        data:{name:e.value},
                        dataType:'json',//服务器返回json格式数据
                        type:'post',//HTTP请求类型
                        timeout:10000,//超时时间设置为10秒；
                        headers:{'Content-Type':'application/json'},
                        success:function(data){
                            if(data == 1){
                                mui.toast("昵称修改为："+e.value);
                                window.location.reload();
                            }else{
                                mui.toast(data);
                            }
                        },
                        error:function(xhr,type,errorThrown){
                            //异常处理；
                            console.log(type);
                        }
                    });
                }else{
                    mui.toast('昵称不能为空');
                }
            }
        });
    });
    mui('body').on('tap','a',function(){document.location.href=this.href;});
</script>
</html>